package ie.nell;

import android.view.KeyEvent;
import android.webkit.WebView;
import android.webkit.WebViewClient;

/**
 *
 * @author stw
 */
public class UXWebViewClient extends WebViewClient {

    private final UXBrowser uxb;
    
    public UXWebViewClient(UXBrowser uxbref) {
        uxb = uxbref;
    }

    @Override
    public boolean shouldOverrideKeyEvent(WebView view, KeyEvent event) {
        return false;
    }

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {
        uxb.recordURL(url);
        return false;
    }

    @Override
    public void onPageFinished(WebView view, String url) {
        uxb.setTitle(view.getTitle());
    }
}
